<%--
    Sofa Control is a computer remote control designed for handheld devices
    Copyright (C) 2009 Adrián Romero Corchado
    http://code.google.com/p/sofacontrol/

    This file is part of Sofa Control.

    Sofa Control is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Sofa Control is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Sofa Control.  If not, see <http://www.gnu.org/licenses/>.

    Document   : index
    Created on : 09-jul-2008, 23:01:22
    Author     : adrian
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	    <meta id="viewport" name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
        
        <title>Sofa control</title>

        <link rel="stylesheet" type="text/css" href="default.css" />

        <script type="text/javascript" src="js/prototype-1.6.0.2.js"></script>
        <script type="text/javascript">
            function sendKey(key) {
                 new Ajax.Request('key', {
                  method:'get',
                  parameters: {value: key},
                  onSuccess: function(transport){
                      // alert(transport.responseText);
                   },
                   onFailure: function(){ alert('Something went wrong...') }
                });
            }

            var currentmedia = null;

            function showmedia(medianame) {

                if (currentmedia != null) {
                    document.getElementById(currentmedia).style.display = 'none';
                }

                if (medianame != null) {
                    document.getElementById(medianame).style.display = 'block';
                }

                currentmedia = medianame;
            }
            
            window.onload = function() {
              setTimeout(function(){window.scrollTo(0, 1);}, 100);
              showmedia("media");
            }           
        </script>
    </head>
    <body>

<%--
    <div id="topbar">
        <input type="button" value="A" onclick="showmedia('media');"/>
        <input type="button" value="B" onclick="showmedia('keyboard');"/>
        <input type="button" value="C" onclick="sendKey('c');"/>
        Sofa control
    </div>

    <div id="bottombar">
        <input type="button" value="d" style="background-image: url(images/1uparrow.png)"/>
        <input type="button" value="cucu"/>
        <button type="button" style="padding: 30px"><img src="images/1uparrow.png"/></button>
        <button type="button" style="padding: 30px">Click Me!</button>
    </div>
--%>
    <div id="bottombar">
        <input type="button" value="Media" onclick="showmedia('media');"/>
        <input type="button" value="Keyboard" onclick="showmedia('keyboard');"/>
    </div>

    <div id ="keyboards">

    <% pageContext.include("/media.jsp"); %>
    <% pageContext.include("/keyboard.jsp"); %>

    </div>

      
    </body>
</html>
